#pragma once
#include "Bucket.h"
//Klasse die als Knoten der Binar Baumes dient
//Jeder Knoten speichert eine liste von Pfade
//die alle den selben abstand zum original Bild haben
//so wie der Abstand selbst und referenz zum Fater Knoten
//und den Kindern
ref class Node
{
   
private:  
	float key;
	Bucket^ elements;
	Node^ left;
	Node^ right;
	Node^ parent;
	int balance;
public:
	inline Node(float k, Node^ p){key = k;right = nullptr;left = nullptr;parent = p;balance = 0;elements = gcnew Bucket();}
	inline void add(System::String^ path){elements->push(path);}
	inline System::String^ remove(){return elements->isEmpty()? nullptr : elements->pop();}
	inline float getKey(){return key;}
	inline  System::Collections::ArrayList^ getElements(){return elements->toArray();}
	inline bool isEmpty(){return elements->isEmpty();}
	inline void setLeft(Node^ l){left = l;}
	inline void setRight(Node^ r){right = r;}
	inline void setBalance(int n){balance = n;}
	inline void setParent(Node^ n) {parent = n;}
	inline Node^ getLeft(){return left;}
	inline Node^ getRight(){return right;}
	inline Node^ getParent(){return parent;}
	inline int getBalance(){return balance;}
};